這個就厲害了,一路跟著我們學習過來的朋友,一定了解,我們的model得在dialogflow的console上面做訓練,才能做使用。
但 dialogflow的sdk 讓邊訓練邊使用,變的可能。
沒錯,是真的.
參考
https://github.com/googleapis/nodejs-dialogflow
const createIntentRequest = {
    parent: agentPath,
    intent: intent,
  };
  // Create the intent
  intentsClient
    .createIntent(createIntentRequest)
    .then(responses => {
      console.log(`Intent ${responses[0].name} created`);
    })
    .catch(err => {
      console.error('ERROR:', err);
    });
  // [END dialogflow_create_intent]
}
這是節錄Create Intent範例中的一段,只要照這個,就可以動態新增intent。
也就是說例如你有個 home bot ,本來你要開電燈,開空調,要分開講兩次。
你現在可以設計一個能動態訓練自已的bot,要求這個bot將動作合一。